<template>
<div class='shop1'>
    <!-- 药店店铺 -->
         <div class='firstFloor-wrap'>
            <div class="first-left" v-for="(date,index) in  myObj" :key="index">
              <div class='floor-header'>
                <span class='serve'>热门服务</span>
                <span class='allShop'><a>全部</a></span>
              </div>
              <div class='floor-items' ref="slider">
                  <div class="left-item">
                    <div class="item-rank">1</div>
                    <div class="card-wrap">
                        <a href="#">
                          <div class='card-header'><img :src="date.shopCover" alt=""></div>
                          <div class="card-title">{{date.shopName}}</div>
                          <div class='description'>地址：{{date.shopLocation}}</div>
                          <div class='phone'>电话：{{date.shopPhone}}</div>
                        </a>
                    </div>
                  </div>
                  <ul class="right-item">
                    <li class='item-li' v-for="(shop,index) in shops" :key="index">
                      <div class="item-rank1">{{index+2}}</div>
                      <div class="card-wrap">
                          <a href="">
                            <div class='card-header1'><img :src="shop.img"></div>
                            <div class="card-title">{{shop.name}}</div>
                            <div class='description'>{{shop.appe}}</div>
                          </a>
                      </div>
                    </li>
                   
                  </ul>
              </div>
              <ul class='floor-bottom'>
                <li class="bottom-li" v-for="(store,index) in stores" :key="index">
                  <a>
                    <div class="title">{{store.title}}</div>
                    <div class="desc">{{store.desc}}</div>
                  </a>
                </li>
              </ul>
            </div>
            <!-- <div class="first-right">
              <div class='floor-header'>
                <span class='serve'>同行在用</span>
                <span class='allShop'><a>全部</a></span>
              </div>
              <div class='floor-items'>
                  <div class="left-item">
                    <div class="item-rank">1</div>
                    <div class="card-wrap">
                        <a href="#">
                          <div class='card-header'><img src="../../assets/ld/img/shop.png" alt=""></div>
                          <div class="card-title">淘宝旺铺</div>
                           <div class='description'>很好</div>
                        </a>
                    </div>
                  </div>
                  <ul class="right-item">
                    <li class='item-li' v-for="(shop,index) in shops" :key="index">
                      <div class="item-rank1">{{index+2}}</div>
                      <div class="card-wrap">
                          <a href="">
                            <div class='card-header1'><img :src="shop.img"></div>
                            <div class="card-title">{{shop.name}}</div>
                            <div class='description'>{{shop.appe}}</div>
                          </a>
                      </div>
                    </li>
                   
                  </ul>
              </div>
              <ul class='floor-bottom'>
                <li class="bottom-li" v-for="(store,index) in stores" :key="index">
                  <a>
                    <div class="title">{{store.title}}</div>
                    <div class="desc">{{store.desc}}</div>
                  </a>
                </li>
              </ul>
            </div> -->
         </div>
</div>
         
</template>
<script>
export default {
    name:'Center',
    data() {
        return {
            myData:{},
            input:'',
            shops:[
            {img:require('../../assets/ld/img/shop.png'),name:'美折促销',appe:'真不错'},
            {img:require('../../assets/ld/img/shop.png'),name:'超级店长',appe:'真不错'},
            {img:require('../../assets/ld/img/shop.png'),name:'优惠券',appe:'真不错'},
            {img:require('../../assets/ld/img/shop.png'),name:'爱用交易',appe:'真不错'},
            ],
            stores:[
            {title:'6.欢乐逛打折',desc:'促销'},
            {title:'7.爱用商品',desc:'促销'},
            {title:'8.快递助手',desc:'促销'},
            {title:'9.打包配',desc:'促销'},
            ],
        }
    },
    mounted() {
      const path =this.$router.path;
      this.$http.get('http://zzal.top:8082/shops/home/show/all')
      .then(res=>{
        this.myData=res.data.data
      })
      .catch(error=>{
        console.log(error);
      })
    },
    computed:{
      myObj:{
        get:function(){
          return this.myData
        }
      }
    }
}
</script>
<style scoped>
.shop1{
    width: 100%;
}
    /* 药店的商铺 */
  .firstFloor-wrap{
      margin: 0 auto;
      margin-top: 20px;
      margin-bottom: 100px;
      display: grid;
      width: 94%;
  }
  .first-left{
    margin-right: 20px;
    box-shadow: 0 2px 8px 0 rgb(0 0 0 / 3%);
    background-color: #fff;
    display: inline-block;
    /* width: 590px; */
  }
  .first-right{
    box-shadow: 0 2px 8px 0 rgb(0 0 0 / 3%);
    background-color: #fff;
    display: inline-block;
    /* width: 590px; */
  }
  .floor-header{
    box-sizing: border-box;
    background-color: #fafafa;
    display: inline-block;
    width: 100%;
    padding: 15px 18px;
    height: 60px;
  }
  .serve{
    font-weight: 700;
    font-size: 24PX;
    font-weight: bold;
  }
  .allShop{
    font-size: 14px;
    float: right;
    line-height: 25px;
  }
  .allShop a{
    text-decoration: none;
    color: #666;
  }
   .allShop a:hover{
    color: #007bff;
    cursor: pointer;
   }
  /* 中间 */
  .floor-items{
    display: table;
    width: 100%;
    height: 368px;
    box-sizing: border-box;
  }
  .floor-items a{
    text-decoration: none;
    color: block;
  }
  .left-item{
    display: table-cell;
    position: relative;
    cursor: pointer;
    width: 274px;
    border: 1px solid #fff;
    border-right: 1px solid #f1f1f1;
    border-bottom: 1px solid #f1f1f1;
    vertical-align: top;
  }
  .left-item:hover{
    border: 1px solid #4997da;
  }
  .item-rank{
    position: absolute;
    background: url('../../assets/ld/img/back1.png') no-repeat 0;
    background-size: 28px 34px;
    width: 28px;
    height: 34px;
    top: 15px;
    left: 13px;
    color: #fff;
    text-align: center;
    line-height: 45px;
    font-weight: 600;
  }
  .card-wrap{
    font-family: HiraginoSansGB-W3;
    text-align: center;
    padding-top: 15px;
  }
  .card-header{
    width: 180px;
    height: 180px;
    display: inline-block;
    line-height: 1;
    position: relative;
  }
.card-header img{
  width: 100%;
  height: 100%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
}
.card-title{
    text-align: center;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 5px 30px;
}
/* 中间的右边 */
.right-item{
  display: table-cell;
  width: 315px;
  list-style: none;
}
.item-li{
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid #f1f1f1;
    border-right: 1px solid #f1f1f1;
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
    float: left;
    width: 50%;
    box-sizing: border-box;
}
.item-li:hover{
  border: 1px solid #4997da;
}
.item-rank1{
    position: absolute;
    background: url("../../assets/ld/img/back2.png") no-repeat 0;
    background-size: 16px 19px;
    width: 16px;
    height: 19px;
    top: 15px;
    left: 13px;
    color: #fff;
    text-align: center;
    line-height: 16px;
}
.card-header1{
    width: 80px;
    height: 80px;
    display: inline-block;
    line-height: 1;
    position: relative;
  }
.card-header1 img{
  width: 100%;
  height: 100%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
}
/* 底部 */
.floor-bottom{
      list-style: none;
  width: 100%;
  display: table;
}
.bottom-li{
    font-family: MicrosoftYaHei;
    font-size: 12px;
    color: #999;
    padding: 20px 0;
    cursor: pointer;
    text-align: center;
    border: 1px solid #fff;
    width: 25%;
    display: inline-block;
    box-sizing: border-box;
}
.title{
    display: inline-block;
    color: #333;
    font-size: 14px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    vertical-align: bottom;
    padding: 2px 0;
}
.desc{
      padding: 2px 0;
}
.description,.phone{
    padding-bottom: 5px;
    height: 19px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;   
}
</style>